package com.grad.webstudy.model;

import java.io.Serializable;

public class CourseDetail implements Serializable {
    private Integer id;

    private Integer chapterId;

    private String name;

    private Integer sequence;

    private String videoPath;

    private String videoLength;

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getChapterId() {
        return chapterId;
    }

    public void setChapterId(Integer chapterId) {
        this.chapterId = chapterId;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name == null ? null : name.trim();
    }

    public Integer getSequence() {
        return sequence;
    }

    public void setSequence(Integer sequence) {
        this.sequence = sequence;
    }

    public String getVideoPath() {
        return videoPath;
    }

    public void setVideoPath(String videoPath) {
        this.videoPath = videoPath == null ? null : videoPath.trim();
    }

    public String getVideoLength() {
        return videoLength;
    }

    public void setVideoLength(String videoLength) {
        this.videoLength = videoLength == null ? null : videoLength.trim();
    }


    @Override
    public String toString() {
        return "CourseDetail{" +
                "id=" + id +
                ", chapterId=" + chapterId +
                ", name='" + name + '\'' +
                ", sequence=" + sequence +
                ", videoPath='" + videoPath + '\'' +
                ", videoLength='" + videoLength + '\'' +
                '}';
    }


    public CourseDetail() {
    }

    public CourseDetail(Builder builder) {

        this.id = builder.id;
        this.chapterId = builder.chapterId;
        this.name = builder.name;
        this.sequence = builder.sequence;
        this.videoPath = builder.videoPath;
        this.videoLength = builder.videoLength;
    }


    public static class Builder {
        private Integer id;

        private Integer chapterId;

        private String name;

        private Integer sequence;

        private String videoPath;

        private String videoLength;

        public Builder setId(Integer id) {
            this.id = id;
            return this;
        }

        public Builder setChapterId(Integer chapterId) {
            this.chapterId = chapterId;
            return this;
        }

        public Builder setName(String name) {
            this.name = name;
            return this;
        }

        public Builder setSequence(Integer sequence) {
            this.sequence = sequence;
            return this;
        }

        public Builder setVideoPath(String videoPath) {
            this.videoPath = videoPath;
            return this;
        }

        public Builder setVideoLength(String videoLength) {
            this.videoLength = videoLength;
            return this;
        }

        public CourseDetail build() {
            return new CourseDetail(this);
        }
    }
}